local skel = fk.CreateSkill {
  name = "rmt__shandian",
}

skel:addEffect("active", {
  anim_type = "offensive",
  card_num = 0,
  target_num = 1,
  prompt = "#rmt__daitian",
  target_tip = function (self, player, to, selected)
    if to:getMark("rmt__daitian_tar") ~= 0 then
      return "@@rmt__daitian_tar"
    elseif table.every(Fk:currentRoom().alive_players, function (p) return p == to or p.hp <= to.hp end) then
      return "@@rmt__daitian_max"
    end
  end,
  times = function (self, player)
    return 1 - player:usedSkillTimes(skel.name, Player.HistoryPhase)
  end,
  card_filter = Util.FalseFunc,
  target_filter = function (self, player, to, selected)
    return #selected == 0 and (to:getMark("rmt__daitian_tar") ~= 0
    or table.every(Fk:currentRoom().alive_players, function (p)
      return p == to or p.hp <= to.hp
    end))
  end,
  can_use = function(self, player)
    return player:usedSkillTimes(skel.name, Player.HistoryPhase) == 0
  end,
  on_use = function(self, room, effect)
    local player = effect.from
    local to = effect.tos[1]
    room:damage { from = player, to = to, damage = 1, skillName = skel.name }
  end,
})

Fk:loadTranslationTable{
  ["rmt__shandian"] = "闪电",
  [":rmt__shandian"] = "出牌阶段限一次，你可以对体力值唯一最高，或受到过“代天”伤害的角色造成1点伤害。因“闪电”造成击杀后，你可以将武将名改为“闪电”。",
  ["#daitian_changehero"] = "代天变身",
  ["#rmt__daitian-changehero"] = "你可以将变身为“闪电”！",
  ["rmt__lightningguy"] = "闪电",

  ["$rmt__shandian1"] = "我当要替天行道！",
  ["$rmt__shandian2"] = "我就是天意啊",
}

return skel
